import request from '@/utils/request'

// 查询租户列表
export function listSysTenant (query) {
  return request({
    url: '/system/sysTenant/list',
    method: 'get',
    params: query
  })
}

// 查询租户详细
export function getSysTenant (id) {
  return request({
    url: '/system/sysTenant/' + id,
    method: 'get'
  })
}

// 新增租户
export function addSysTenant (data) {
  return request({
    url: '/system/sysTenant',
    method: 'post',
    data: data
  })
}

// 修改租户
export function updateSysTenant (data) {
  return request({
    url: '/system/sysTenant',
    method: 'put',
    data: data
  })
}

// 状态修改
export function updateStatus (id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/sysTenant/updateStatus',
    method: 'put',
    data: data
  })
}

// 删除租户
export function delSysTenant (id) {
  return request({
    url: '/system/sysTenant/' + id,
    method: 'delete'
  })
}


// 导出租户
export function exportSysTenant (query) {
  return request({
    url: '/system/sysTenant/export',
    method: 'get',
    params: query
  })
}

// 获取初始化数据
export function getInitData (dictTypes) {
  return request({
    url: '/system/sysTenant/getInitData/' + dictTypes,
    method: 'get'
  })
}
